import {INodeImpl} from "@rockyf/easy-design";

export default function () {
  return {
    setup(): HTMLElement {
      const el = document.createElement('div')
      el.classList.add('node-label')
      return el
    },
    hooks: {
      update(props?: Record<string, any>) {
        this.host!.innerHTML = props?.text
        this.host!.style.textAlign = props?.textAlign ?? 'left'
      }
    }
  } as INodeImpl
}